-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(http prober): #1285 implement cache http response #1296
feat(http prober): #1285 implement cache http response #1296
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1296 +/- ##
==========================================
+ Coverage 62.51% 63.53% +1.01%
==========================================
Files 112 109 -3
Lines 3391 3409 +18
Branches 591 580 -11
==========================================
+ Hits 2120 2166 +46
+ Misses 1079 1058 -21
+ Partials 192 185 -7 ☔ View full report in Codecov by Sentry. |
Wouldn't it be easier if we use the library with tested code such as https://www.npmjs.com/package/@isaacs/ttlcache? |
@haricnugraha Updated cache backend with said package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, ok to merge.
btw: Do we have memory consumption for say a cache of 100 probe reponses? 1000?
@sapiderman A typical web page like youtube and sentry.io is around 500 kilobytes for their html text.
For 100 probes of web pages, I'd say it would be around 50 megabytes. |
Monika Pull Request (PR)
This PR resolves #1285
What feature/issue does this PR add
src/components/probe/prober/http/response-cache.ts
: in-memory cache for HTTP responseHow did you implement / how did you fix it
@isaac/ttl-cache
HTTPProber
to use cached response on first probing attempt--ttl-cache
to set cache's time-to-live--verbose-cache
to monitor cache useHow to test
npm run start -- --verbose-cache
Cache HIT
andCache MISS